home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swaga_c.zip / CHARS.SWG / 0007_Text Fonts in ASM.pas < prev    next >
Pascal/Delphi Source File  |  1993-11-26  |  1KB  |  50 lines

  1. {
  2. From: SEAN PALMER
  3. Subj: Text Fonts in ASM
  4. }
  5.  
  6. Procedure SetAsciiChar(Charnum : Word; Var Data); Assembler;
  7. ASM
  8.    mov ah,11h
  9.    mov al,10h
  10.    mov bh,10h
  11.    mov bl,0
  12.    mov cx,1      {set 1 character only}
  13.    mov dx,charnum     {what charnum to modify }
  14.    mov bp,seg data   {seg of the char}
  15.    mov es,bp
  16.    mov bp,offset data  {ofs of the char}
  17.    int 10h
  18. End;
  19.  
  20. {
  21. This has been reputed to work. Although I didn't write it (Salim Samhara
  22. I think is who did) and if I did I would have changed it to load ax and
  23. bx as one unit instead of ah and al, then bh and bl. With this though
  24. you have to have the buffer in the data segment, not on the stack.
  25.  
  26. So here's how I would do it:
  27. }
  28.  
  29. Procedure LoadFont (FileName : String);
  30. Type
  31.  FontType=Array [char] of Array [0..15] of Byte;
  32. Var
  33.  F    : File of FontType;
  34.  Font : FontType;
  35. Begin
  36.  Assign (F, FileName);
  37.  Reset (F);
  38.  Read (F,Font);
  39.  Close (F);
  40.  Asm
  41.   mov ax,$1100
  42.   mov bx,$1000
  43.   mov cx,$0100
  44.   xor dx,dx
  45.   mov es,seg Font
  46.   mov bp,offset Font
  47.   Int $10
  48.   end;
  49.  End;
  50.